{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<a href=\"https://csdms.colorado.edu/wiki/ESPIn2020\"><img style=\"float: center; width: 75%\" src=\"../../media/ESPIn.png\"></a>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "[![Webinar](../../media/OO.png)](https://youtu.be/dLrahDArm4w)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# What is Object Oriented programming\n",
    "\n",
    "- OOP is a way of modeling a programming problem\n",
    "- Concepts: class, object\n",
    "- Terms: attribute (data), methods (behavior)\n",
    "\n",
    "\"A bike\" (class) \n",
    "Bikes have attributes: (brakes, handle bars, wheels\n",
    "Bikes have behaviors : move, steer, brake \n",
    "\n",
    "Objects or instances of the bike class: \n",
    "-\"Mark's 1996 Specialized Stumpjumper FS\" (object)\n",
    "-\"My Bianchi Sprint bikes\" \n",
    "\n",
    "OOP requires some time to write and develop good classes.\n",
    "\n",
    "The following notebook is based on a recent [webinar](https://youtu.be/dLrahDArm4w) we recorded at CSDMS. You can find the [Slideshow](https://github.com/csdms/level-up/blob/master/info/Level-3-Object-oriented-Programming.pdf) and a more elaborate example here [python_corona_simulation](https://github.com/BCampforts/python_corona_simulation),which is forked from [paulvangentcom](https://github.com/paulvangentcom/python_corona_simulation).\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## How to code a class\n",
    "\n",
    "### Define a Virus class\n",
    "\n",
    "1. Properties\n",
    "    - name \n",
    "    - infection_range\n",
    "    - infection_chance\n",
    "    - recovery_duration\n",
    "\n",
    "2. Methods\n",
    "    - documentSelf()\n",
    "\n",
    "###  Create two virus objects (instances of the class Virus) \n",
    " - ebola\n",
    " - sars \n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "class Virus: \n",
    "    pass"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Instances v1 and v2\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Document self"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Make subclass lethal virus"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
